﻿Imports System.IO
Public Class Main 'NOTE: I coded most of this in 10th grade, before I actually knew anything. I know this is all terrible code. Please don't tell me it's terrible code. I can code better now. 
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        'Yeah, I don't know why this is first. 
        On Error Resume Next
        Dim url As String = My.Settings.blinks6
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with this button::" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        On Error Resume Next
        Me.KeyPreview = True
        If Screen.PrimaryScreen.WorkingArea.Width = 1366 Then
            Me.WindowState = FormWindowState.Maximized
        Else

        End If
        If Screen.PrimaryScreen.WorkingArea.Width = 1024 Then

        End If
        themestart()

        If File.Exists("background.jpg") Then
            Me.BackgroundImage = Image.FromFile("background.jpg")
            Me.BackgroundImageLayout = ImageLayout.Stretch
        Else
        End If
        ' initiate week manager
        If Directory.Exists("week") Then

        Else
            Directory.CreateDirectory("week")
            firststart.Show()
            splash.Close()
            Me.Hide()
        End If
        If File.Exists("week/select.kwl") Then

        Else
            File.Create("week/select.kwl")
        End If
        Dim weekselect As String
        weekselect = File.ReadAllText("week/select.kwl")

        Button8.Hide()


        'Create main Directories

        If Directory.Exists("week/dump") Then

        Else
            Directory.CreateDirectory("week/dump")
        End If

        If Directory.Exists("week/data") Then

        Else
            Directory.CreateDirectory("week/data")
        End If


        'Create Files


        If File.Exists("week/weeksdata.kwl") Then

        Else
            File.Create("week/weeksdata.kwl")
        End If


        If weekselect = "" Then ' Create default week if string weekselect is empty

            weekselect = "Week 1"

            If Directory.Exists("week/" + weekselect) Then

            Else
                Directory.CreateDirectory("week/" + weekselect)
            End If
            If File.Exists("week/data/" + weekselect) Then

            Else
                File.Create("week/data/" + weekselect)
            End If

            If File.Exists("week/" + weekselect + "/P1Monday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P1Monday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P1Tusday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P1Tusday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P1Wednesday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P1Wednesday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P1Thursday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P1Thursday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P1Friday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P1Friday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P2Monday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P2Monday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P2Tusday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P2Tusday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P2Wednesday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P2Wednesday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P2Thursday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P2Thursday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P2Friday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P2Friday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P3Monday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P3Monday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P3Tusday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P3Tusday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P3Wednesday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P3Wednesday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P3Thursday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P3Thursday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P3Friday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P3Friday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P4Monday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P4Monday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P4Tusday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P4Tusday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P4Wednesday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P4Wednesday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P4Thursday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P4Thursday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P4Friday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P4Friday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P5Monday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P5Monday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P5Tusday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P5Tusday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P5Wednesday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P5Wednesday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P5Thursday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P5Thursday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P5Friday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P5Friday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P6Monday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P6Monday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P6Tusday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P6Tusday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P6Wednesday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P6Wednesday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P6Thursday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P6Thursday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/P6Friday.kwl") Then

            Else
                File.Create("week/" + weekselect + "/P6Friday.kwl")

            End If

            If File.Exists("week/" + weekselect + "/Notes.kwl") Then

            Else
                File.Create("week/" + weekselect + "/Notes.kwl")

            End If

        Else

        End If

        If File.Exists("week/dump/P1Monday.kwl") Then

        Else
            File.Create("week/dump/P1Monday.kwl")

        End If

        If File.Exists("week/dump/P1Tusday.kwl") Then

        Else
            File.Create("week/dump/P1Tusday.kwl")

        End If

        If File.Exists("week/dump/P1Wednesday.kwl") Then

        Else
            File.Create("week/dump/P1Wednesday.kwl")

        End If

        If File.Exists("week/dump/P1Thursday.kwl") Then

        Else
            File.Create("week/dump/P1Thursday.kwl")

        End If

        If File.Exists("week/dump/P1Friday.kwl") Then

        Else
            File.Create("week/dump/P1Friday.kwl")

        End If

        If File.Exists("week/dump/P2Monday.kwl") Then

        Else
            File.Create("week/dump/P2Monday.kwl")

        End If

        If File.Exists("week/dump/P2Tusday.kwl") Then

        Else
            File.Create("week/dump/P2Tusday.kwl")

        End If

        If File.Exists("week/dump/P2Wednesday.kwl") Then

        Else
            File.Create("week/dump/P2Wednesday.kwl")

        End If

        If File.Exists("week/dump/P2Thursday.kwl") Then

        Else
            File.Create("week/dump/P2Thursday.kwl")

        End If

        If File.Exists("week/dump/P2Friday.kwl") Then

        Else
            File.Create("week/dump/P2Friday.kwl")

        End If

        If File.Exists("week/dump/P3Monday.kwl") Then

        Else
            File.Create("week/dump/P3Monday.kwl")

        End If

        If File.Exists("week/dump/P3Tusday.kwl") Then

        Else
            File.Create("week/dump/P3Tusday.kwl")

        End If

        If File.Exists("week/dump/P3Wednesday.kwl") Then

        Else
            File.Create("week/dump/P3Wednesday.kwl")

        End If

        If File.Exists("week/dump/P3Thursday.kwl") Then

        Else
            File.Create("week/dump/P3Thursday.kwl")

        End If

        If File.Exists("week/dump/P3Friday.kwl") Then

        Else
            File.Create("week/dump/P3Friday.kwl")

        End If

        If File.Exists("week/dump/P4Monday.kwl") Then

        Else
            File.Create("week/dump/P4Monday.kwl")

        End If

        If File.Exists("week/dump/P4Tusday.kwl") Then

        Else
            File.Create("week/dump/P4Tusday.kwl")

        End If

        If File.Exists("week/dump/P4Wednesday.kwl") Then

        Else
            File.Create("week/dump/P4Wednesday.kwl")

        End If

        If File.Exists("week/dump/P4Thursday.kwl") Then

        Else
            File.Create("week/dump/P4Thursday.kwl")

        End If

        If File.Exists("week/dump/P4Friday.kwl") Then

        Else
            File.Create("week/dump/P4Friday.kwl")

        End If

        If File.Exists("week/dump/P5Monday.kwl") Then

        Else
            File.Create("week/dump/P5Monday.kwl")

        End If

        If File.Exists("week/dump/P5Tusday.kwl") Then

        Else
            File.Create("week/dump/P5Tusday.kwl")

        End If

        If File.Exists("week/dump/P5Wednesday.kwl") Then

        Else
            File.Create("week/dump/P5Wednesday.kwl")

        End If

        If File.Exists("week/dump/P5Thursday.kwl") Then

        Else
            File.Create("week/dump/P5Thursday.kwl")

        End If

        If File.Exists("week/dump/P5Friday.kwl") Then

        Else
            File.Create("week/dump/P5Friday.kwl")

        End If

        If File.Exists("week/dump/P6Monday.kwl") Then

        Else
            File.Create("week/dump/P6Monday.kwl")

        End If

        If File.Exists("week/dump/P6Tusday.kwl") Then

        Else
            File.Create("week/dump/P6Tusday.kwl")

        End If

        If File.Exists("week/dump/P6Wednesday.kwl") Then

        Else
            File.Create("week/dump/P6Wednesday.kwl")

        End If

        If File.Exists("week/dump/P6Thursday.kwl") Then

        Else
            File.Create("week/dump/P6Thursday.kwl")

        End If

        If File.Exists("week/dump/P6Friday.kwl") Then

        Else
            File.Create("week/dump/P6Friday.kwl")

        End If

        If File.Exists("week/dump/Notes.kwl") Then

        Else
            File.Create("week/dump/Notes.kwl")

        End If

        ' Create Theme file (March 11, 2014) I no longer intend on recoding to use one master database file, just work woth whats here.

        If My.Settings.customthemeYN = 0 Then

            linkButtons(42)
        Else

            linkButtons(0)
        End If

        NotifyIcon1.ContextMenuStrip = ContextMenuStrip1


        Label42.Text = weekselect
        Button7.PerformClick()
        Button8.Hide()

        If firststart.Visible Then
            Me.Hide()
            splash.Hide()
            splash.Close()
            Application.Restart()
            Exit Sub
        End If

        If My.Settings.Sidebar = 1 Then

            CheckBox1.CheckState = CheckState.Checked
        Else
            CheckBox1.CheckState = CheckState.Unchecked
        End If


        Label39.Text = "©  " + My.Computer.Clock.LocalTime.Year.ToString + " Kowal Laboratories "


        If Err.Number <> 0 Then
            MsgBox("A error occured:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, "DRSS Homework Manager")
        Else

        End If


    End Sub

    Public Function linkButtons(button As Integer)

        Dim blinks(10) As String  ' blinks is actually b(as in button)-links. 
        If button = 42 Then
            blinks(0) = "Dayton STEM School"
            blinks(1) = "Open Progress Book"
            blinks(2) = "Open Pilot"
            blinks(3) = "Open Email"
            blinks(4) = "Open MEGA"
            blinks(5) = "http://daytonstemschool.org"
            blinks(6) = "https://gb.mdeca.org/ParentAccess/"
            blinks(7) = "https://pilot.wright.edu"
            blinks(8) = "http://wings.wright.edu"
            blinks(9) = "https://mega.co.nz"
            blinks(10) = "DRSS Homework Manager | "

            My.Settings.blinks0 = blinks(0)
            My.Settings.blinks1 = blinks(1)
            My.Settings.blinks2 = blinks(2)
            My.Settings.blinks3 = blinks(3)
            My.Settings.blinks4 = blinks(4)
            My.Settings.blinks5 = blinks(5)
            My.Settings.blinks6 = blinks(6)
            My.Settings.blinks7 = blinks(7)
            My.Settings.blinks8 = blinks(8)
            My.Settings.blinks9 = blinks(9)
            My.Settings.blinks10 = blinks(10)
            My.Settings.Save()




        Else                                                    ' This should always run!

            blinks(0) = My.Settings.blinks0
            blinks(1) = My.Settings.blinks1
            blinks(2) = My.Settings.blinks2
            blinks(3) = My.Settings.blinks3
            blinks(4) = My.Settings.blinks4
            blinks(5) = My.Settings.blinks5
            blinks(6) = My.Settings.blinks6
            blinks(7) = My.Settings.blinks7
            blinks(8) = My.Settings.blinks8
            blinks(9) = My.Settings.blinks9
            blinks(10) = My.Settings.blinks10

            Button11.Text = blinks(0)
            Button1.Text = blinks(1)
            Button5.Text = blinks(2)
            Button6.Text = blinks(3)
            Button9.Text = blinks(4)
            Label1.Text = blinks(10)

        End If
        If button < 10 Then
            startBlinkThing(button, blinks(button))
            Return DBNull.Value
        End If

        If button = 4242 Then
            Return blinks(10)
        End If

        'textb1 = blinks(0)
        'textb2 = blinks(1)
        'textb3 = blinks(2)
        'textb4 = blinks(3)
        'textb5 = blinks(4)
        'linkb1 = blinks(5)
        'linkb2 = blinks(6)
        'linkb3 = blinks(7)
        'linkb4 = blinks(8)
        'linkb5 = blinks(9)

        Return DBNull.Value
    End Function

    Private Sub startBlinkThing(button As Integer, blinks As String)
        Process.Start(blinks)
    End Sub
    
    Public Sub themestart()
        If My.Settings.theme = 0 Then
            If File.Exists("background.jpg") Then
            Else
                Me.BackgroundImage = My.Resources.drsshm6
                Me.BackgroundImageLayout = ImageLayout.Center
            End If

            Label1.ForeColor = Color.White
            Label2.ForeColor = Color.White
            Label3.ForeColor = Color.White
            Label4.ForeColor = Color.White
            Label5.ForeColor = Color.White
            Label6.ForeColor = Color.White
            'Label7.ForeColor = Color.White
            Label8.ForeColor = Color.White
            Label9.ForeColor = Color.White
            Label10.ForeColor = Color.White
            Label11.ForeColor = Color.White
            Label12.ForeColor = Color.White
            Label13.ForeColor = Color.White
            Label14.ForeColor = Color.White
            Label15.ForeColor = Color.White
            Label16.ForeColor = Color.White
            Label17.ForeColor = Color.White
            Label18.ForeColor = Color.White
            Label19.ForeColor = Color.White
            Label20.ForeColor = Color.White
            Label21.ForeColor = Color.White
            Label22.ForeColor = Color.White
            Label23.ForeColor = Color.White
            Label24.ForeColor = Color.White
            Label25.ForeColor = Color.White
            Label26.ForeColor = Color.White
            Label27.ForeColor = Color.White
            Label28.ForeColor = Color.White
            Label29.ForeColor = Color.White
            Label30.ForeColor = Color.White
            Label31.ForeColor = Color.White
            Label32.ForeColor = Color.White
            Label33.ForeColor = Color.White
            Label34.ForeColor = Color.White
            Label35.ForeColor = Color.White
            Label36.ForeColor = Color.White
            Label37.ForeColor = Color.White
            Label38.ForeColor = Color.White
            Label39.ForeColor = Color.White
            Label40.ForeColor = Color.White
            Label41.ForeColor = Color.White
            Label42.ForeColor = Color.White
            Button1.BackColor = Color.White

            Button3.BackColor = Color.White
            Button4.BackColor = Color.White
            Button5.BackColor = Color.White
            Button6.BackColor = Color.White
            Button7.BackColor = Color.White
            Button8.BackColor = Color.White
            Button9.BackColor = Color.White
            Button10.BackColor = Color.White
            Button11.BackColor = Color.White
            Button12.BackColor = Color.White
            Button14.BackColor = Color.White
            Button1.ForeColor = Color.Black

            Button3.ForeColor = Color.Black
            Button4.ForeColor = Color.Black
            Button5.ForeColor = Color.Black
            Button6.ForeColor = Color.Black
            Button7.ForeColor = Color.Black
            Button8.ForeColor = Color.Black
            Button9.ForeColor = Color.Black
            Button10.ForeColor = Color.Black
            Button11.ForeColor = Color.Black
            Button12.ForeColor = Color.Black
            Button14.ForeColor = Color.Black
            Dim myFont As System.Drawing.Font
            myFont = New System.Drawing.Font("Microsoft Sans Serif", 8)
            Button1.Font = myFont

            Button3.Font = myFont
            Button4.Font = myFont
            Button5.Font = myFont
            Button6.Font = myFont
            Button7.Font = myFont
            Button8.Font = myFont
            Button9.Font = myFont
            Button10.Font = myFont
            Button11.Font = myFont
            Button12.Font = myFont
            Button14.Font = myFont
            m1.BackColor = Color.White
            m2.BackColor = Color.White
            m3.BackColor = Color.White
            m4.BackColor = Color.White
            m5.BackColor = Color.White
            m6.BackColor = Color.White
            tu1.BackColor = Color.White
            tu2.BackColor = Color.White
            tu3.BackColor = Color.White
            tu4.BackColor = Color.White
            tu5.BackColor = Color.White
            tu6.BackColor = Color.White
            w1.BackColor = Color.White
            w2.BackColor = Color.White
            w3.BackColor = Color.White
            w4.BackColor = Color.White
            w5.BackColor = Color.White
            w6.BackColor = Color.White
            tr1.BackColor = Color.White
            tr2.BackColor = Color.White
            tr3.BackColor = Color.White
            tr4.BackColor = Color.White
            tr5.BackColor = Color.White
            tr6.BackColor = Color.White
            f1.BackColor = Color.White
            f2.BackColor = Color.White
            f3.BackColor = Color.White
            f4.BackColor = Color.White
            f5.BackColor = Color.White
            f6.BackColor = Color.White
            notes.BackColor = Color.White
            MonthCalendar1.BackColor = Color.White
            MonthCalendar1.TitleBackColor = Color.LightBlue
            m1.Font = myFont
            m2.Font = myFont
            m3.Font = myFont
            m4.Font = myFont
            m5.Font = myFont
            m6.Font = myFont
            tu1.Font = myFont
            tu2.Font = myFont
            tu3.Font = myFont
            tu4.Font = myFont
            tu5.Font = myFont
            tu6.Font = myFont
            w1.Font = myFont
            w2.Font = myFont
            w3.Font = myFont
            w4.Font = myFont
            w5.Font = myFont
            w6.Font = myFont
            tr1.Font = myFont
            tr2.Font = myFont
            tr3.Font = myFont
            tr4.Font = myFont
            tr5.Font = myFont
            tr6.Font = myFont
            f1.Font = myFont
            f2.Font = myFont
            f3.Font = myFont
            f4.Font = myFont
            f5.Font = myFont
            f6.Font = myFont
        End If
        If My.Settings.theme = 1 Then
            If File.Exists("background.jpg") Then
            Else
                Me.BackgroundImage = My.Resources.drsshm79
                Me.BackgroundImageLayout = ImageLayout.Stretch
            End If

            Label1.ForeColor = Color.LightGray
            Label2.ForeColor = Color.LightGray
            Label3.ForeColor = Color.LightGray
            Label4.ForeColor = Color.LightGray
            Label5.ForeColor = Color.LightGray
            Label6.ForeColor = Color.LightGray
            'Label7.ForeColor = Color.LightGray
            Label8.ForeColor = Color.LightGray
            Label9.ForeColor = Color.LightGray
            Label10.ForeColor = Color.LightGray
            Label11.ForeColor = Color.LightGray
            Label12.ForeColor = Color.LightGray
            Label13.ForeColor = Color.LightGray
            Label14.ForeColor = Color.LightGray
            Label15.ForeColor = Color.LightGray
            Label16.ForeColor = Color.LightGray
            Label17.ForeColor = Color.LightGray
            Label18.ForeColor = Color.LightGray
            Label19.ForeColor = Color.LightGray
            Label20.ForeColor = Color.LightGray
            Label21.ForeColor = Color.LightGray
            Label22.ForeColor = Color.LightGray
            Label23.ForeColor = Color.LightGray
            Label24.ForeColor = Color.LightGray
            Label25.ForeColor = Color.LightGray
            Label26.ForeColor = Color.LightGray
            Label27.ForeColor = Color.LightGray
            Label28.ForeColor = Color.LightGray
            Label29.ForeColor = Color.LightGray
            Label30.ForeColor = Color.LightGray
            Label31.ForeColor = Color.LightGray
            Label32.ForeColor = Color.LightGray
            Label33.ForeColor = Color.LightGray
            Label34.ForeColor = Color.LightGray
            Label35.ForeColor = Color.LightGray
            Label36.ForeColor = Color.LightGray
            Label37.ForeColor = Color.LightGray
            Label38.ForeColor = Color.LightGray
            Label39.ForeColor = Color.LightGray
            Label40.ForeColor = Color.LightGray
            Label41.ForeColor = Color.LightGray
            Label42.ForeColor = Color.LightGray
            Button1.BackColor = Color.Transparent

            Button3.BackColor = Color.Transparent
            Button4.BackColor = Color.Transparent
            Button5.BackColor = Color.Transparent
            Button6.BackColor = Color.Transparent
            Button7.BackColor = Color.Transparent
            Button8.BackColor = Color.Transparent
            Button9.BackColor = Color.Transparent
            Button10.BackColor = Color.Transparent
            Button11.BackColor = Color.Transparent
            Button12.BackColor = Color.Transparent
            Button14.BackColor = Color.Transparent

            Dim myFont2 As System.Drawing.Font
            myFont2 = New System.Drawing.Font("Verdana", 9.75)
            Button1.Font = myFont2

            Button3.Font = myFont2
            Button4.Font = myFont2
            Button5.Font = myFont2
            Button6.Font = myFont2
            Button7.Font = myFont2
            Button8.Font = myFont2
            Button9.Font = myFont2
            Button10.Font = myFont2
            Button11.Font = myFont2
            Button12.Font = myFont2
            Button14.Font = myFont2
            Button1.ForeColor = Color.LightGray

            Button3.ForeColor = Color.LightGray
            Button4.ForeColor = Color.LightGray
            Button5.ForeColor = Color.LightGray
            Button6.ForeColor = Color.LightGray
            Button7.ForeColor = Color.LightGray
            Button8.ForeColor = Color.LightGray
            Button9.ForeColor = Color.LightGray
            Button10.ForeColor = Color.LightGray
            Button11.ForeColor = Color.LightGray
            Button12.ForeColor = Color.LightGray
            Button14.ForeColor = Color.LightGray
            m1.BackColor = Color.Silver
            m2.BackColor = Color.Silver
            m3.BackColor = Color.Silver
            m4.BackColor = Color.Silver
            m5.BackColor = Color.Silver
            m6.BackColor = Color.Silver
            tu1.BackColor = Color.Silver
            tu2.BackColor = Color.Silver
            tu3.BackColor = Color.Silver
            tu4.BackColor = Color.Silver
            tu5.BackColor = Color.Silver
            tu6.BackColor = Color.Silver
            w1.BackColor = Color.Silver
            w2.BackColor = Color.Silver
            w3.BackColor = Color.Silver
            w4.BackColor = Color.Silver
            w5.BackColor = Color.Silver
            w6.BackColor = Color.Silver
            tr1.BackColor = Color.Silver
            tr2.BackColor = Color.Silver
            tr3.BackColor = Color.Silver
            tr4.BackColor = Color.Silver
            tr5.BackColor = Color.Silver
            tr6.BackColor = Color.Silver
            f1.BackColor = Color.Silver
            f2.BackColor = Color.Silver
            f3.BackColor = Color.Silver
            f4.BackColor = Color.Silver
            f5.BackColor = Color.Silver
            f6.BackColor = Color.Silver
            notes.BackColor = Color.Silver
            MonthCalendar1.BackColor = Color.Silver
            MonthCalendar1.TitleBackColor = Color.Gray
            ContextMenuStrip1.BackColor = Color.LightGray

        End If
    End Sub
    Private Sub keys_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
        If (e.Control AndAlso (e.KeyCode = Keys.S)) Then
            Me.Button8_Click(sender, New System.EventArgs())
        End If
        If (e.Control AndAlso (e.KeyCode = Keys.ShiftKey)) Then
            MsgBox("Easter Egg: The main window is now sizable.")
            Me.FormBorderStyle = Windows.Forms.FormBorderStyle.Sizable
        End If

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        If word1.Visible = True Then
            word1.Hide()
            power1.Hide()
            excel1.Hide()
        Else
            word1.Show()
            power1.Show()
            excel1.Show()
        End If


    End Sub
    Private Sub officeHide()
        word1.Hide()
        power1.Hide()
        excel1.Hide()
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        On Error Resume Next
        Dim url As String = My.Settings.blinks7
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with this button:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        On Error Resume Next
        Dim url As String = My.Settings.blinks8
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with this button:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        save()
    End Sub
    Public Sub save()

        On Error Resume Next
        Dim weekselect As String
        Dim errormessage As String
        Dim text = Nothing
        weekselect = File.ReadAllText("week/select.kwl")
        If weekselect = "" Then
            weekselect = "Week 1"
        Else

        End If
        'Monday
        writem1(weekselect, text)
        writem2(weekselect, text)
        writem3(weekselect, text)
        writem4(weekselect, text)
        writem5(weekselect, text)
        writem6(weekselect, text)
        'Tuesday
        writetu1(weekselect, text)
        writetu2(weekselect, text)
        writetu3(weekselect, text)
        writetu4(weekselect, text)
        writetu5(weekselect, text)
        writetu6(weekselect, text)
        'Wednesday
        writew1(weekselect, text)
        writew2(weekselect, text)
        writew3(weekselect, text)
        writew4(weekselect, text)
        writew5(weekselect, text)
        writew6(weekselect, text)
        'Thursday
        writetr1(weekselect, text)
        writetr2(weekselect, text)
        writetr3(weekselect, text)
        writetr4(weekselect, text)
        writetr5(weekselect, text)
        writetr6(weekselect, text)
        'Frieday
        writef1(weekselect, text)
        writef2(weekselect, text)
        writef3(weekselect, text)
        writef4(weekselect, text)
        writef5(weekselect, text)
        writef6(weekselect, text)
        'Notes
        writenotes(weekselect, text)

        Button8.Hide()
        If Err.Number <> 0 Then
            MsgBox("A error occured:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, "DRSS Homework Manager")
        Else

        End If
    End Sub
    Public Sub writem1(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P1Monday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(m1.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writem2(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P2Monday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(m2.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writem3(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P3Monday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(m3.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writem4(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P4Monday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(m4.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writem5(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P5Monday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(m5.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writetu1(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P1Tusday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(tu1.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writetu2(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P2Tusday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(tu2.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writetu3(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P3Tusday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(tu3.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writetu4(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P4Tusday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(tu4.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writetu5(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P5Tusday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(tu5.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writew1(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P1Wednesday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(w1.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writew2(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P2Wednesday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(w2.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writew3(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P3Wednesday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(w3.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writew4(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P4Wednesday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(w4.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writew5(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P5Wednesday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(w5.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writetr1(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P1Thursday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(tr1.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writetr2(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P2Thursday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(tr2.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writetr3(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P3Thursday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(tr3.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writetr4(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P4Thursday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(tr4.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writetr5(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P5Thursday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(tr5.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writef1(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P1Friday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(f1.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writef2(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P2Friday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(f2.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writef3(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P3Friday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(f3.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writef4(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P4Friday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(f4.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writef5(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P5Friday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(f5.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writenotes(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/Notes.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(notes.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writem6(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P6Monday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(m6.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writetu6(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P6Tusday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(tu6.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writew6(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P6Wednesday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(w6.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writetr6(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P6Thursday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(tr6.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Public Sub writef6(weekselect As String, text As String)
        Dim FILE_NAME As String = "week/" + weekselect + "/P6Friday.kwl"
        If File.Exists(FILE_NAME) = True Then
            Dim objWriter As New StreamWriter(FILE_NAME)
            If text = Nothing Then
                objWriter.Write(f6.Text)
                objWriter.Close()
            Else
                objWriter.Write(text)
                objWriter.Close()
            End If
        Else
            errorMessageFileMissing()
        End If
    End Sub
    Private Sub errorMessageFileMissing()
        MsgBox("A File is missing. Reinstall at once.")
    End Sub

    Public Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        ' NOTICE: This is for the "Load Saved Work" button, which was made invisible in dev .14. It is here as a 'unanticipated variable' fallback option. 
        ' UPDATE (02/17/2014): Turns out this is needed. Don't touch it.
        reload(saveB:=False)
    End Sub
    Public Sub reload(saveB As Boolean)
        On Error Resume Next
        Dim weekselect As String
        weekselect = File.ReadAllText("week/select.kwl")
        If weekselect = "" Then
            weekselect = "Week 1"
        Else

        End If
        m1.LoadFile("week/" + weekselect + "/P1Monday.kwl", RichTextBoxStreamType.PlainText)
        tu1.LoadFile("week/" + weekselect + "/P1Tusday.kwl", RichTextBoxStreamType.PlainText)
        w1.LoadFile("week/" + weekselect + "/P1Wednesday.kwl", RichTextBoxStreamType.PlainText)
        tr1.LoadFile("week/" + weekselect + "/P1Thursday.kwl", RichTextBoxStreamType.PlainText)
        f1.LoadFile("week/" + weekselect + "/P1Friday.kwl", RichTextBoxStreamType.PlainText)
        'Period 2
        m2.LoadFile("week/" + weekselect + "/P2Monday.kwl", RichTextBoxStreamType.PlainText)
        tu2.LoadFile("week/" + weekselect + "/P2Tusday.kwl", RichTextBoxStreamType.PlainText)
        w2.LoadFile("week/" + weekselect + "/P2Wednesday.kwl", RichTextBoxStreamType.PlainText)
        tr2.LoadFile("week/" + weekselect + "/P2Thursday.kwl", RichTextBoxStreamType.PlainText)
        f2.LoadFile("week/" + weekselect + "/P2Friday.kwl", RichTextBoxStreamType.PlainText)
        'Period 3
        m3.LoadFile("week/" + weekselect + "/P3Monday.kwl", RichTextBoxStreamType.PlainText)
        tu3.LoadFile("week/" + weekselect + "/P3Tusday.kwl", RichTextBoxStreamType.PlainText)
        w3.LoadFile("week/" + weekselect + "/P3Wednesday.kwl", RichTextBoxStreamType.PlainText)
        tr3.LoadFile("week/" + weekselect + "/P3Thursday.kwl", RichTextBoxStreamType.PlainText)
        f3.LoadFile("week/" + weekselect + "/P3Friday.kwl", RichTextBoxStreamType.PlainText)
        'Period 4
        m4.LoadFile("week/" + weekselect + "/P4Monday.kwl", RichTextBoxStreamType.PlainText)
        tu4.LoadFile("week/" + weekselect + "/P4Tusday.kwl", RichTextBoxStreamType.PlainText)
        w4.LoadFile("week/" + weekselect + "/P4Wednesday.kwl", RichTextBoxStreamType.PlainText)
        tr4.LoadFile("week/" + weekselect + "/P4Thursday.kwl", RichTextBoxStreamType.PlainText)
        f4.LoadFile("week/" + weekselect + "/P4Friday.kwl", RichTextBoxStreamType.PlainText)
        'Period 5
        m5.LoadFile("week/" + weekselect + "/P5Monday.kwl", RichTextBoxStreamType.PlainText)
        tu5.LoadFile("week/" + weekselect + "/P5Tusday.kwl", RichTextBoxStreamType.PlainText)
        w5.LoadFile("week/" + weekselect + "/P5Wednesday.kwl", RichTextBoxStreamType.PlainText)
        tr5.LoadFile("week/" + weekselect + "/P5Thursday.kwl", RichTextBoxStreamType.PlainText)
        f5.LoadFile("week/" + weekselect + "/P5Friday.kwl", RichTextBoxStreamType.PlainText)
        'Period 6
        m6.LoadFile("week/" + weekselect + "/P6Monday.kwl", RichTextBoxStreamType.PlainText)
        tu6.LoadFile("week/" + weekselect + "/P6Tusday.kwl", RichTextBoxStreamType.PlainText)
        w6.LoadFile("week/" + weekselect + "/P6Wednesday.kwl", RichTextBoxStreamType.PlainText)
        tr6.LoadFile("week/" + weekselect + "/P6Thursday.kwl", RichTextBoxStreamType.PlainText)
        f6.LoadFile("week/" + weekselect + "/P6Friday.kwl", RichTextBoxStreamType.PlainText)
        'Other
        notes.LoadFile("week/" + weekselect + "/Notes.kwl", RichTextBoxStreamType.PlainText)
        Button7.Hide()
        If saveB = True Then
            Button8.PerformClick()
        End If
        If Err.Number <> 0 Then
            MsgBox("A error occured:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, "DRSS Homework Manager")
        End If
    End Sub
    Public Sub setBack()
        Dim ofd As New OpenFileDialog
        With ofd
            .CheckFileExists = True
            .Filter = "Image Files (*.jpg)|*.jpg"
            .Title = "Change your planner's background image:"
            .ShowDialog()
        End With

        If DialogResult = Windows.Forms.DialogResult.OK AndAlso ofd.FileName <> "" Then

        Else
            Try
                If File.Exists(ofd.FileName) Then
                    Me.BackgroundImage.Dispose()
                    If File.Exists("background.jpg") Then
                        File.Delete("background.jpg")
                    End If
                    File.Copy(ofd.FileName, "background.jpg")
                    KHM.theme.backgroundWasSet(bwset:=True)
                    Me.BackgroundImage = Image.FromFile(ofd.FileName)
                    Me.BackgroundImageLayout = ImageLayout.Stretch
                    

                Else

                    Exit Sub
                End If
            Catch ex As Exception
                MsgBox(ex.Message)
                Debug.Print(ex.Message)
            End Try
            If ofd.FileName = "" Then
                KHM.theme.backgroundWasSet(bwset:=False)
                Exit Sub
            Else



            End If

        End If
    End Sub
    Private Sub tu2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tu2.TextChanged    'slightly out of place
        Button8.Show()
    End Sub

    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
        On Error Resume Next
        Dim url As String = My.Settings.blinks9
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with this button:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
        about.Show()

    End Sub

    Private Sub Button11_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
        On Error Resume Next
        Dim url As String = My.Settings.blinks5
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with this button:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub notes_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles notes.TextChanged
        Button8.Show()
    End Sub

    Private Sub m1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles m1.TextChanged
        Button8.Show()
    End Sub

    Private Sub tu1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tu1.TextChanged
        Button8.Show()
    End Sub

    Private Sub w1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles w1.TextChanged
        Button8.Show()
    End Sub

    Private Sub tr1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tr1.TextChanged
        Button8.Show()
    End Sub

    Private Sub f1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles f1.TextChanged
        Button8.Show()
    End Sub

    Private Sub m2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles m2.TextChanged
        Button8.Show()
    End Sub

    Private Sub w2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles w2.TextChanged
        Button8.Show()
    End Sub

    Private Sub tr2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tr2.TextChanged
        Button8.Show()
    End Sub

    Private Sub f2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles f2.TextChanged
        Button8.Show()
    End Sub

    Private Sub m3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles m3.TextChanged
        Button8.Show()
    End Sub

    Private Sub f3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles f3.TextChanged
        Button8.Show()
    End Sub

    Private Sub w3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles w3.TextChanged
        Button8.Show()
    End Sub

    Private Sub tr3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tr3.TextChanged
        Button8.Show()
    End Sub

    Private Sub tu3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tu3.TextChanged
        Button8.Show()
    End Sub

    Private Sub m4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles m4.TextChanged
        Button8.Show()
    End Sub

    Private Sub tu4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tu4.TextChanged
        Button8.Show()
    End Sub

    Private Sub f4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles f4.TextChanged
        Button8.Show()
    End Sub

    Private Sub tr4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tr4.TextChanged
        Button8.Show()
    End Sub

    Private Sub w4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles w4.TextChanged
        Button8.Show()
    End Sub

    Private Sub m5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles m5.TextChanged
        Button8.Show()
    End Sub

    Private Sub tu5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tu5.TextChanged
        Button8.Show()
    End Sub

    Private Sub w5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles w5.TextChanged
        Button8.Show()
    End Sub

    Private Sub tr5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tr5.TextChanged
        Button8.Show()
    End Sub

    Private Sub f5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles f5.TextChanged
        Button8.Show()
    End Sub

    Private Sub m6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles m6.TextChanged
        Button8.Show()
    End Sub

    Private Sub f6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles f6.TextChanged
        Button8.Show()
    End Sub

    Private Sub w6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles w6.TextChanged
        Button8.Show()
    End Sub

    Private Sub tr6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tr6.TextChanged
        Button8.Show()
    End Sub

    Private Sub tu6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tu6.TextChanged
        Button8.Show()
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        If login1.Visible = True Then
            login1.Hide()
            map1.Hide()
        Else
            login1.Show()
            map1.Show()
        End If


    End Sub

    Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click

        theme.Show()
    End Sub


    Private Sub Msgbox_Yes_No()

    End Sub

    Private Sub NotifyIcon1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick

    End Sub
    Public Sub NotifyIcon1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDown
        If e.Button = MouseButtons.Left Then
            Me.Show()
            sidebar.Close()
        End If
        If Me.WindowState = FormWindowState.Minimized Then
            Me.WindowState = FormWindowState.Maximized
            sidebar.Close()
        End If
        Me.BringToFront()
    End Sub
    Private Sub Form1_FormClosing(ByVal sender As Object, _
                              ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        If e.CloseReason = CloseReason.UserClosing Then
            'The user has requested the form be closed so mimimise to the system tray instead (ignore the user!!!!).
            e.Cancel = True
            Me.Visible = False
            Me.NotifyIcon1.Visible = True
        End If
        If CheckBox1.CheckState = CheckState.Checked Then
            sidebar.Show()
        End If
    End Sub
    Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
        Try
            If Me.WindowState = FormWindowState.Minimized Then
                Me.WindowState = FormWindowState.Minimized
                NotifyIcon1.Visible = True
                Me.Hide()
            End If
        Catch ex As Exception
        End Try
        If Me.WindowState = FormWindowState.Maximized Then
        Else
            If Me.Visible Then
            Else
                If CheckBox1.CheckState = CheckState.Checked Then
                    sidebar.Show()

                End If
            End If

        End If

    End Sub
    Private Sub NotifyIcon1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
        If e.Button = MouseButtons.Right Then NotifyIcon1.ContextMenuStrip.Show()
    End Sub
    Private Sub ContextMenuStrip1_Opening(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
        ' Do something if notifyicon's menu is shown
    End Sub

    Public Sub ToolStripMenuItem1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Exitmenuitem.Click
        On Error Resume Next
        If CheckBox1.CheckState = CheckState.Checked Then
            My.Settings.Sidebar = 1
            My.Settings.Save()

        End If
        If CheckBox1.CheckState = CheckState.Unchecked Then
            My.Settings.Sidebar = 0
            My.Settings.Save()
        End If
        Me.Show()
        If Button8.Visible Then
            If MessageBox.Show("You may have unsaved changes. Would you like to save these changes?", "Save", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then
                Button8.PerformClick()
                If Err.Number <> 0 Then
                    MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
                Else
                End If
                My.Settings.Save()
                End
            End If
        End If
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
        End
    End Sub

    Private Sub PilotToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PilotToolStripMenuItem.Click
        On Error Resume Next
        Dim url As String = "https://pilot.wright.edu"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub EmailToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EmailToolStripMenuItem.Click
        On Error Resume Next
        Dim url As String = "https://wings.wright.edu"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub ContextMenuStrip1_Opening_1(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ContextMenuStrip1.Opening

    End Sub

    Private Sub SkydriveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SkydriveToolStripMenuItem.Click
        On Error Resume Next
        Dim url As String = "https://mega.co.nz"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub ProgressBookToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProgressBookToolStripMenuItem.Click
        On Error Resume Next
        Dim url As String = "https://gb.mdeca.org/ParentAccess/"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
        showWeekBox()
    End Sub
    Public Sub showWeekBox()
        weeks.Show()
    End Sub

    Private Sub WordToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WordToolStripMenuItem.Click
        wordStart()

    End Sub

    Private Sub PowerpointToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PowerpointToolStripMenuItem.Click
        powerStart()
    End Sub

    Private Sub ExcelToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExcelToolStripMenuItem.Click
        excelStart()
    End Sub

    Private Sub CalculatorToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalculatorToolStripMenuItem.Click
        If File.Exists("C:/WINDOWS/system32/calc.exe") Then
            System.Diagnostics.Process.Start("C:/WINDOWS/system32/calc.exe")
        Else
            MsgBox("The Calculator is not present on this computer.(?!?!)")
        End If
    End Sub

    Private Sub getNotify()
        ' NOTE: In dev. 14 and beyond, this sub has no purpose. It is remnants of the Notify system
        On Error Resume Next
        Dim weekselect As String
        weekselect = File.ReadAllText("week/select.kwl")

        If My.Settings.notify = 0 Then
            MsgBox("No notifications to give. Set some in the 'Customize' menu.")
        End If
        If Today.DayOfWeek = DayOfWeek.Monday Then
            If My.Settings.notify = 1 Then
                MsgBox(notifyMonday())

            End If
            If My.Settings.notify = 2 Then
                MsgBox(notifyTuesday())

            End If
            If My.Settings.notify = 3 Then
                MsgBox(notifyMonday() + notifyTuesday())

            End If

        End If
        If Today.DayOfWeek = DayOfWeek.Tuesday Then
            If My.Settings.notify = 1 Then
                MsgBox(notifyTuesday())

            End If
            If My.Settings.notify = 2 Then
                MsgBox(notifyWed())

            End If
            If My.Settings.notify = 3 Then
                MsgBox(notifyTuesday() + notifyWed())

            End If

        End If
        If Today.DayOfWeek = DayOfWeek.Wednesday Then
            If My.Settings.notify = 1 Then
                MsgBox(notifyWed())

            End If
            If My.Settings.notify = 2 Then
                MsgBox(notifyThurs())

            End If
            If My.Settings.notify = 3 Then
                MsgBox(notifyWed() + notifyThurs())

            End If

        End If
        If Today.DayOfWeek = DayOfWeek.Thursday Then
            If My.Settings.notify = 1 Then
                MsgBox(notifyThurs())

            End If
            If My.Settings.notify = 2 Then
                MsgBox(notifyFri())

            End If
            If My.Settings.notify = 3 Then
                MsgBox(notifyThurs() + notifyFri())

            End If
        End If
        If Today.DayOfWeek = DayOfWeek.Friday Then
            If My.Settings.notify = 1 Then
                MsgBox(notifyFri())

            End If
            If My.Settings.notify = 2 Then
                MsgBox(notifyMonday())

            End If
            If My.Settings.notify = 3 Then
                MsgBox(notifyFri() + notifyMonday())

            End If

        Else

        End If
        If Today.DayOfWeek = DayOfWeek.Saturday Then
            If My.Settings.notify = 1 Then
                MsgBox(notifyMonday())

            End If
            If My.Settings.notify = 2 Then
                MsgBox(notifyMonday())

            End If
            If My.Settings.notify = 3 Then
                MsgBox(notifyMonday() + notifyTuesday() + "What are you doing looking at this on a saturday?! Get a life!")

            End If
        Else

        End If
        If Today.DayOfWeek = DayOfWeek.Sunday Then
            If My.Settings.notify = 1 Then
                MsgBox(notifyMonday())

            End If
            If My.Settings.notify = 2 Then
                MsgBox(notifyMonday())

            End If
            If My.Settings.notify = 3 Then
                MsgBox(notifyMonday() + notifyTuesday())

            End If

        End If

        
        'MsgBox("Things due tomorrow for week: " + File.ReadAllText("week/select.kwl") + vbNewLine + "Period 1: " + mper1 + vbNewLine + "Period 2: " + mper2 + vbNewLine + "Period 3: " + mper3 + vbNewLine + "Period 4: " + mper4 + vbNewLine + "Period 5: " + mper5 + vbNewLine + "Period 6: " + mper6)



        If Err.Number <> 0 Then
            MsgBox("A error occured:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, "DRSS Homework Manager")
        Else

        End If
    End Sub

    Private Function notifyMonday()
        Dim weekselect As String
        weekselect = File.ReadAllText("week/select.kwl")
        Dim mper1 As String
        Dim mper2 As String
        Dim mper3 As String
        Dim mper4 As String
        Dim mper5 As String
        Dim mper6 As String
        mper1 = File.ReadAllText("week/" + weekselect + "/P1Monday.kwl")
        mper2 = File.ReadAllText("week/" + weekselect + "/P2Monday.kwl")
        mper3 = File.ReadAllText("week/" + weekselect + "/P3Monday.kwl")
        mper4 = File.ReadAllText("week/" + weekselect + "/P4Monday.kwl")
        mper5 = File.ReadAllText("week/" + weekselect + "/P5Monday.kwl")
        mper6 = File.ReadAllText("week/" + weekselect + "/P6Monday.kwl")
        Dim message As String
        message = ("Things due Monday for week: " + File.ReadAllText("week/select.kwl") + vbNewLine + "Period 1: " + mper1 + vbNewLine + "Period 2: " + mper2 + vbNewLine + "Period 3: " + mper3 + vbNewLine +
            "Period 4: " + mper4 + vbNewLine + "Period 5: " + mper5 + vbNewLine + "Period 6: " + mper6 + vbNewLine + vbNewLine)
        Return message

    End Function

    Private Function notifyTuesday()
        Dim message As String
        Dim weekselect As String
        weekselect = File.ReadAllText("week/select.kwl")
        Dim tper1 As String
        Dim tper2 As String
        Dim tper3 As String
        Dim tper4 As String
        Dim tper5 As String
        Dim tper6 As String
        tper1 = File.ReadAllText("week/" + weekselect + "/P1Tusday.kwl")
        tper2 = File.ReadAllText("week/" + weekselect + "/P2Tusday.kwl")
        tper3 = File.ReadAllText("week/" + weekselect + "/P3Tusday.kwl")
        tper4 = File.ReadAllText("week/" + weekselect + "/P4Tusday.kwl")
        tper5 = File.ReadAllText("week/" + weekselect + "/P5Tusday.kwl")
        tper6 = File.ReadAllText("week/" + weekselect + "/P6Tusday.kwl")
        message = ("Things due Tuesday for week: " + File.ReadAllText("week/select.kwl") + vbNewLine + "Period 1: " + tper1 + vbNewLine + "Period 2: " + tper2 + vbNewLine + "Period 3: " + tper3 + vbNewLine + "Period 4: " + tper4 + vbNewLine + "Period 5: " + tper5 + vbNewLine + "Period 6: " + tper6 + vbNewLine + vbNewLine)
        Return message
    End Function

    Private Function notifyWed()
        Dim weekselect As String
        weekselect = File.ReadAllText("week/select.kwl")
        Dim message As String
        Dim wper1 As String
        Dim wper2 As String
        Dim wper3 As String
        Dim wper4 As String
        Dim wper5 As String
        Dim wper6 As String
        wper1 = File.ReadAllText("week/" + weekselect + "/P1Wednesday.kwl")
        wper2 = File.ReadAllText("week/" + weekselect + "/P2Wednesday.kwl")
        wper3 = File.ReadAllText("week/" + weekselect + "/P3Wednesday.kwl")
        wper4 = File.ReadAllText("week/" + weekselect + "/P4Wednesday.kwl")
        wper5 = File.ReadAllText("week/" + weekselect + "/P5Wednesday.kwl")
        wper6 = File.ReadAllText("week/" + weekselect + "/P6Wednesday.kwl")
        message = ("Things due Wednesday for week: " + File.ReadAllText("week/select.kwl") + vbNewLine + "Period 1: " + wper1 + vbNewLine + "Period 2: " + wper2 + vbNewLine + "Period 3: " + wper3 + vbNewLine + "Period 4: " + wper4 + vbNewLine + "Period 5: " + wper5 + vbNewLine + "Period 6: " + wper6)
        Return message
    End Function

    Private Function notifyThurs()
        Dim weekselect As String
        weekselect = File.ReadAllText("week/select.kwl")
        Dim message As String
        Dim thper1 As String
        Dim thper2 As String
        Dim thper3 As String
        Dim thper4 As String
        Dim thper5 As String
        Dim thper6 As String
        thper1 = File.ReadAllText("week/" + weekselect + "/P1Thursday.kwl")
        thper2 = File.ReadAllText("week/" + weekselect + "/P2Thursday.kwl")
        thper3 = File.ReadAllText("week/" + weekselect + "/P3Thursday.kwl")
        thper4 = File.ReadAllText("week/" + weekselect + "/P4Thursday.kwl")
        thper5 = File.ReadAllText("week/" + weekselect + "/P5Thursday.kwl")
        thper6 = File.ReadAllText("week/" + weekselect + "/P6Thursday.kwl")
        message = ("Things due Thursday for week: " + File.ReadAllText("week/select.kwl") + vbNewLine + "Period 1: " + thper1 + vbNewLine + "Period 2: " + thper2 + vbNewLine + "Period 3: " + thper3 + vbNewLine + "Period 4: " + thper4 + vbNewLine + "Period 5: " + thper5 + vbNewLine + "Period 6: " + thper6)
        Return message
    End Function

    Private Function notifyFri()
        Dim weekselect As String
        weekselect = File.ReadAllText("week/select.kwl")
        Dim message As String
        Dim fper1 As String
        Dim fper2 As String
        Dim fper3 As String
        Dim fper4 As String
        Dim fper5 As String
        Dim fper6 As String
        fper1 = File.ReadAllText("week/" + weekselect + "/P1Friday.kwl")
        fper2 = File.ReadAllText("week/" + weekselect + "/P2Friday.kwl")
        fper3 = File.ReadAllText("week/" + weekselect + "/P3Friday.kwl")
        fper4 = File.ReadAllText("week/" + weekselect + "/P4Friday.kwl")
        fper5 = File.ReadAllText("week/" + weekselect + "/P5Friday.kwl")
        fper6 = File.ReadAllText("week/" + weekselect + "/P6Friday.kwl")
        message = ("Things due Friday for week: " + File.ReadAllText("week/select.kwl") + vbNewLine + "Period 1: " + fper1 + vbNewLine + "Period 2: " + fper2 + vbNewLine + "Period 3: " + fper3 + vbNewLine + "Period 4: " + fper4 + vbNewLine + "Period 5: " + fper5 + vbNewLine + "Period 6: " + fper6)
        Return message
    End Function

    Private Sub NotifyToolStripMenuItem_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs)
        ' Don't know what this is, leaving for research later
    End Sub

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        On Error Resume Next

        If Err.Number <> 0 Then
        End If
    End Sub

    Private Sub CheckBox2_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox2.CheckedChanged

    End Sub

    'Comence link code
    Private Sub WolframAlphaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WolframAlphaToolStripMenuItem.Click
        On Error Resume Next
        Dim url As String = "http://www.wolframalpha.com/"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub KhanAcademyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KhanAcademyToolStripMenuItem.Click
        On Error Resume Next
        Dim url As String = "http://www.khanacademy.org/"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub WikipediaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WikipediaToolStripMenuItem.Click
        On Error Resume Next
        Dim url As String = "http://www.wikipedia.org"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub PurdueOWLToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PurdueOWLToolStripMenuItem.Click
        On Error Resume Next
        Dim url As String = "http://owl.english.purdue.edu/owl/"
        Process.Start(url)
        If Err.Number <> 0 Then
            MsgBox("Something is wrong with your computer:" & vbCrLf & Err.Description & vbCrLf & Err.Source, vbOKOnly - vbExclamation, )
        Else
        End If
    End Sub

    Private Sub BasicMathToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles BasicMathToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=Elementary+Mathematics&a=*C.Elementary+Mathematics-_*ExamplePage-"
        Process.Start(url)
    End Sub

    Private Sub AlToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles AlToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=algebra&lk=4&num=1"
        Process.Start(url)
    End Sub

    Private Sub CalculusToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles CalculusToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=calculus&lk=4&num=1"
        Process.Start(url)
    End Sub

    Private Sub DiscreteMathmaticsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles DiscreteMathmaticsToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=Discrete+Mathematics"
        Process.Start(url)
    End Sub

    Private Sub MechanicsOfMaterialsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles MechanicsOfMaterialsToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=Mechanics"
        Process.Start(url)
    End Sub

    Private Sub StatisticsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles StatisticsToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=Statistics"
        Process.Start(url)
    End Sub

    Private Sub PhysicsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles PhysicsToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=Physics"
        Process.Start(url)
    End Sub

    Private Sub GeographyToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles GeographyToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=Geography"
        Process.Start(url)
    End Sub

    Private Sub MusicTheoryToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles MusicTheoryToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=Music+theory"
        Process.Start(url)
    End Sub

    Private Sub AstronomyToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles AstronomyToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=astronomy&lk=4&num=1"
        Process.Start(url)
    End Sub

    Private Sub TidesToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TidesToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=tides"
        Process.Start(url)
    End Sub

    Private Sub USEconomicIndicatorsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles USEconomicIndicatorsToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=us+economic+indicators"
        Process.Start(url)
    End Sub

    Private Sub WordsAndLanguageToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles WordsAndLanguageToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=Words%20%26%20Linguistics"
        Process.Start(url)
    End Sub

    Private Sub GamingOddsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles GamingOddsToolStripMenuItem.Click
        Dim url As String = "http://www.wolframalpha.com/input/?i=Genomics"
        Process.Start(url)
    End Sub

    Private Sub NavianceToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles NavianceToolStripMenuItem.Click
        Dim url As String = "https://connection.naviance.com/drstems"
        Process.Start(url)
    End Sub

    Private Sub word1_Click(sender As Object, e As EventArgs) Handles word1.Click
        wordStart()
        officeHide()

    End Sub

    Private Sub power1_Click(sender As Object, e As EventArgs) Handles power1.Click
        powerStart()
        officeHide()

    End Sub

    Private Sub excel1_Click(sender As Object, e As EventArgs) Handles excel1.Click
        excelStart()
        officeHide()

    End Sub
    Private Sub wordStart()
        If File.Exists("C:/Program Files (x86)/Microsoft Office/Office15/winword.exe") Then
            System.Diagnostics.Process.Start("C:/Program Files (x86)/Microsoft Office/Office15/winword.exe")
        Else
            MsgBox("Word is not on this computer.")
        End If
    End Sub
    Private Sub powerStart()
        If File.Exists("C:/Program Files (x86)/Microsoft Office/Office15/powerpnt.exe") Then
            System.Diagnostics.Process.Start("C:/Program Files (x86)/Microsoft Office/Office15/powerpnt.exe")
        Else
            MsgBox("Powerpoint is not on this computer.")
        End If
    End Sub
    Private Sub excelStart()
        If File.Exists("C:/Program Files (x86)/Microsoft Office/Office15/excel.exe") Then
            System.Diagnostics.Process.Start("C:/Program Files (x86)/Microsoft Office/Office15/excel.exe")
        Else
            MsgBox("Excel 2010 is not on this computer")
        End If
    End Sub
    Private Sub form1Click() Handles Me.Click
        If word1.Visible = True Then
            word1.Hide()
            power1.Hide()
            excel1.Hide()
        End If
        If login1.Visible = True Then
            login1.Hide()
            map1.Hide()
        End If
    End Sub

    Private Sub login1_Click(sender As Object, e As EventArgs) Handles login1.Click
        autologin.Show()

    End Sub

    Private Sub LoginNowToolStripMenuItem_Click(sender As Object, e As EventArgs)
        autologin.startLogin()
    End Sub

    Private Sub SettingsToolStripMenuItem_Click(sender As Object, e As EventArgs)
        autologin.Show()
    End Sub

    Private Sub map1_Click(sender As Object, e As EventArgs) Handles map1.Click
        skymap.Show()
    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

    End Sub

    Private Sub addAssign_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem1.Click
        KHM.sidebar.topdownHideShow()
    End Sub

    Private Sub GetNotificationsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles GetNotificationsToolStripMenuItem.Click
        getNotify()
    End Sub
End Class
'    This program is free software: you can redistribute it and/or modify
'    it under the terms of the GNU General Public License as published by
'    the Free Software Foundation, either version 3 of the License, or
'    (at your option) any later version.

'    This program is distributed in the hope that it will be useful,
'    but WITHOUT ANY WARRANTY; without even the implied warranty of
'    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'    GNU General Public License for more details.

'    You should have received a copy of the GNU General Public License
'    along with this program.  If not, see <http://www.gnu.org/licenses/>

